<template>
	<view v-if="isShowMask" :class="['mask-packbox', 'flex-all-center', 'fixed']" 
		@click.stop="clickCloseFun" 
	>
		<view @click.stop>
			<slot></slot>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'comMask',
		props: {
			value: {
				type: Boolean,
				default: () => true
			},
			isNeedReadedClose: {
				type: Boolean,
				default: () => true
			},
		},
		data() {
			return {
				
			};
		},
		computed: {
			isShowMask: {
				get() {
					return this.value;
				},
				set(v) {
					this.$emit('input', v);
				}
			},
		},
		methods: {
			clickCloseFun() {
				if (!this.isNeedReadedClose) return;
				this.isShowMask = false;
				return false;
			}
		}
	};
</script>

<style scoped>
	.mask-packbox {
		z-index: 1000;
		left: 0;
		top: 0;
		width: 100vw;
		height: 100vh;
		animation-duration: 2800;
		background-color: rgba(0, 0, 0, 0.8);
	}
</style>
